import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const path = require('path')
import vueJsx from '@vitejs/plugin-vue-jsx'
// https://vitejs.dev/config/
export default defineConfig({
  envDir: path.resolve(__dirname, './env'),
  plugins: [vue(),, vueJsx()],
  resolve: {
    alias: [
      { find: /^@\//, replacement: `${path.resolve(__dirname, "./src")}/` },
    ],
  },
  server: {
    proxy: {
      // 选项写法
      '/admin': {
        target: 'http://127.0.0.0.1:8686',
        changeOrigin: true,
        rewrite: (path) => path.replace('/admin', '')
      },
    }
  }
})
